package com.zy.web.demo.duoxiancheng.demo20;

import java.io.IOException;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;

/**
 * @author <a href="mailto:zhouyong@cqyyt.com">zy</a>
 * @version 1.0
 * @date 2020/8/20 14:13
 */
public class WriteData {

    public static final int INT = 300;

    public void WriteMethod(PipedOutputStream out){
        try {
            System.out.println("write:");
            for (int i = 0; i < INT; i++) {
                String outData = ""+(i+1);
                out.write(outData.getBytes());
                System.out.println(outData);
            }
            System.out.println();
            out.close();
        }catch (IOException e){
            e.printStackTrace();
        }
    }

}
